package com.wwwarehouse.resource_center.bean.rules;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Joseph on 2017/11/4.
 *         <p/>
 */

public class StocksBean implements Parcelable {


    /**
     * total : 4
     * size : 1
     * page : 1
     * list : [{"stockUkid":22126200000002000,"stockName":"花花最美仓库1号"},{"stockUkid":22133200000002010,"stockName":"我的大仓库"},{"stockUkid":22133900000002011,"stockName":"不像你下决心超级巨星"},{"stockUkid":22136700000325723,"stockName":"颜的大金库"}]
     */

    private int total;
    private int size;
    private int page;
    private List<ListBean> list;

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public List<ListBean> getList() {
        return list;
    }

    public void setList(List<ListBean> list) {
        this.list = list;
    }

    public static class ListBean implements Parcelable {
        /**
         * stockUkid : 22126200000002000
         * stockName : 花花最美仓库1号
         */

        private String stockUkid;
        private String stockName;
        private boolean isSelect ;

        public boolean isSelect() {
            return isSelect;
        }

        public void setSelect(boolean select) {
            isSelect = select;
        }

        public String getStockUkid() {
            return stockUkid;
        }

        public void setStockUkid(String stockUkid) {
            this.stockUkid = stockUkid;
        }

        public String getStockName() {
            return stockName;
        }

        public void setStockName(String stockName) {
            this.stockName = stockName;
        }

        public ListBean() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.stockUkid);
            dest.writeString(this.stockName);
            dest.writeByte(this.isSelect ? (byte) 1 : (byte) 0);
        }

        protected ListBean(Parcel in) {
            this.stockUkid = in.readString();
            this.stockName = in.readString();
            this.isSelect = in.readByte() != 0;
        }

        public static final Creator<ListBean> CREATOR = new Creator<ListBean>() {
            @Override
            public ListBean createFromParcel(Parcel source) {
                return new ListBean(source);
            }

            @Override
            public ListBean[] newArray(int size) {
                return new ListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.total);
        dest.writeInt(this.size);
        dest.writeInt(this.page);
        dest.writeList(this.list);
    }

    public StocksBean() {
    }

    protected StocksBean(Parcel in) {
        this.total = in.readInt();
        this.size = in.readInt();
        this.page = in.readInt();
        this.list = new ArrayList<ListBean>();
        in.readList(this.list, ListBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<StocksBean> CREATOR = new Parcelable.Creator<StocksBean>() {
        @Override
        public StocksBean createFromParcel(Parcel source) {
            return new StocksBean(source);
        }

        @Override
        public StocksBean[] newArray(int size) {
            return new StocksBean[size];
        }
    };
}
